package cn.mdmm.socket;

import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;

public class SocketService {
	public static final String IP_ADDR = "localhost";// 服务器地址
	public static final int PORT = 8888;// 服务器端口号

	public static void main(String[] args) throws IOException {
		try {
			// 1、创建客户端Socket，指定服务器地址和端口
			Socket socket = new Socket(IP_ADDR, PORT);
			System.out.println("客户端启动成功");

			new SendThread(socket).start();
			
			new ReceiveThread(socket).start();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
